<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    // extends 扩展 
    class Dad{
        constructor(age,hobby){
            this.age = age;
            this.hobby = hobby;
        }
        fn(){
            console.log("fn");
        }
        myfn(){
            console.log("我是myfn，父类的");
        }
    }
    class Son extends Dad{
        // super 方法
        constructor(age,hobby){
            super(age,hobby);
            this.height = "178cm";
        }
        sonfn(){
            console.log("我是sonfn方法");
            super.myfn();
        }
    }
    let zhangsi = new Son(56,"篮球");
    console.log(zhangsi);
    zhangsi.fn();
</script>